const webpack = require("webpack");
module.exports = {
  configureWebpack: () => {
    // 取消console打印
    // if (process.env.NODE_ENV === "production") {
    //   config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true;
    // }
    if (process.env.NODE_ENV !== "production") {
      console.log("vue3.0项目启动");
    }
    return {
      plugins: [
        new webpack.ProvidePlugin({
          $: "jquery",
          jQuery: "jquery",
          "windows.jQuery": "jquery"
        })
      ]
    };
  },
  css: {
    loaderOptions: {
      sass: {
        additionalData: `@import "@/assets/css/main.scss";`
      },
      scss: {
        additionalData: `@import "@/assets/css/main.scss";`
      }
      // postcss: {
      //   plugins: [
      //     require("postcss-px2rem")({
      //       remUnit: 37.5
      //     })
      //   ]
      // }
    }
  },
  publicPath: "./", //输出的根路径  默认是/ 如果你的网站是app.com/vue 这更改此配置项
  devServer: {
    open: true
  }
};
